trigger updateProjectNameonAccount on Booking_Details__c (before insert, before update) {

    List<id> accIdList = new List<id>();
    Map<string, string> accIdProjectNameMapping = new Map<string, string>();
    List<Account> accListforUpdate = new List<Account>();

    for (Booking_Details__c bd: trigger.new){
        accIdList.add(bd.Account__c);
        accIdProjectNameMapping.put(bd.Account__c, bd.Project__c);
    }
    system.debug('accIdProjectNameMapping: '+accIdProjectNameMapping);
    for (Account acc:[Select id, CRN__c from Account where id IN:accIdList]){
        acc.Project_Name__c = accIdProjectNameMapping.get(acc.id);
        accListforUpdate.add(acc);
    }
    system.debug('accListforUpdate: '+accListforUpdate);
    system.debug('accListforUpdate: '+accListforUpdate[0].Project_Name__c);

    update accListforUpdate;
}